Hide RDTSCP feature flag from PV guests.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 2 Feb 2007 16:07:13 +0000 (16:07 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 2 Feb 2007 16:07:13 +0000 (16:07 +0000)
Linux 2.6.19 (x86-64) makes use of this feature if available, but Xen
(validly) fails the attempt to write the respective MSR. Hence the
feature must be hidden from PV guests.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/arch/x86/traps.c
xen/include/asm-x86/cpufeature.h

index 16b1e48ca80e3bcf5118ec5eb6abd2a7103d3bb4..dfa22bce041856aba661dd137780ac606b5e559e 100644 (file)
@@ -597,6 +597,11 @@ static int emulate_forced_invalid_op(struct cpu_user_regs *regs)
         if ( !IS_PRIV(current->domain) )
             clear_bit(X86_FEATURE_MTRR, &d);
     }
+    else if ( regs->eax == 0x80000001 )
+    {
+        /* Modify Feature Information. */
+        clear_bit(X86_FEATURE_RDTSCP % 32, &d);
+    }
     else
     {
         (void)cpuid_hypervisor_leaves(regs->eax, &a, &b, &c, &d);
index a092a83ad5b9ca0fe34b5ad5ac8dc95e99ba98af..a6f2f757bcee404f754704afc09922fd0823352f 100644 (file)
@@ -49,6 +49,7 @@
 #define X86_FEATURE_MP         (1*32+19) /* MP Capable. */
 #define X86_FEATURE_NX         (1*32+20) /* Execute Disable */
 #define X86_FEATURE_MMXEXT     (1*32+22) /* AMD MMX extensions */
+#define X86_FEATURE_RDTSCP     (1*32+27) /* RDTSCP */
 #define X86_FEATURE_LM         (1*32+29) /* Long Mode (x86-64) */
 #define X86_FEATURE_3DNOWEXT   (1*32+30) /* AMD 3DNow! extensions */
 #define X86_FEATURE_3DNOW      (1*32+31) /* 3DNow! */